//
//  SmsCloudMainAgreementView.m
#import "SmsCloudMainAgreementView.h"
@interface SmsCloudMainAgreementView()
@property (nonatomic,strong) UIImageView *smsCloudUserHeadImgView;
@property (nonatomic,strong) UILabel *smsCloudMainUserHeadLab;
@property (nonatomic,strong) UIImageView *smsCloudUserHeadGoImgView;

@property (nonatomic,strong) UILabel *smsCloudMainVipTitleLab;
@property (nonatomic,strong) UIButton *smsCloudMainOpenVipBtn;
@end
@implementation SmsCloudMainAgreementView
-(instancetype)init{
    if (self == [super init]) {
        [self smsCloudInitView];
    }
    return self;
}
- (void)smsCloudInitView{
    UIImageView * smsCloudUserHeadImgView = [[UIImageView alloc] init];
    smsCloudUserHeadImgView.userInteractionEnabled = true;
    smsCloudUserHeadImgView.image = [SmsCloudHead SmsCloudImageNamed:@"smsCloudHeadUserAgreemnet"];
    [self addSubview:smsCloudUserHeadImgView];
    [smsCloudUserHeadImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@([SmsCloudHead SmsCloudScreewRatio:30]));
        make.top.equalTo(@([SmsCloudHead SmsCloudScreewRatio:32]));
        make.width.equalTo(@([SmsCloudHead SmsCloudScreewRatio:40]));
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:40]));
    }];
    UILabel * smsCloudMainUserHeadLab = [[UILabel alloc] init];
    smsCloudMainUserHeadLab.textColor = [SmsCloudHead SmsCloudColorHexString:@"#222222"];
    smsCloudMainUserHeadLab.font = [UIFont systemFontOfSize:[SmsCloudHead SmsCloudScreewRatio:28] weight:UIFontWeightRegular];
    smsCloudMainUserHeadLab.text = @"用户协议";
    [self addSubview:smsCloudMainUserHeadLab];
    [smsCloudMainUserHeadLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(smsCloudUserHeadImgView.mas_right).offset([SmsCloudHead SmsCloudScreewRatio:22]);
        make.centerY.equalTo(smsCloudUserHeadImgView);
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:39]));
    }];
    UIImageView * smsCloudUserHeadGoImgView = [[UIImageView alloc] init];
    smsCloudUserHeadGoImgView.userInteractionEnabled = true;
    smsCloudUserHeadGoImgView.image = [SmsCloudHead SmsCloudImageNamed:@"smsCloudAgreentGo"];
    [self addSubview:smsCloudUserHeadGoImgView];
    [smsCloudUserHeadGoImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(smsCloudMainUserHeadLab);
        make.right.equalTo(@(-[SmsCloudHead SmsCloudScreewRatio:32]));
        make.width.equalTo(@([SmsCloudHead SmsCloudScreewRatio:10]));
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:18]));
    }];
    UIButton * smsCloudUserHeadGoBtn = [[UIButton alloc] init];
    [smsCloudUserHeadGoBtn addTarget:self action:@selector(smsCloudUserHeadGo) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:smsCloudUserHeadGoBtn];
    [smsCloudUserHeadGoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@([SmsCloudHead SmsCloudScreewRatio:0]));
        make.right.equalTo(@([SmsCloudHead SmsCloudScreewRatio:0]));
        make.top.equalTo(@([SmsCloudHead SmsCloudScreewRatio:0]));
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:104]));
    }];
    
    UIImageView * smsCloudPriHeadImgView = [[UIImageView alloc] init];
    smsCloudPriHeadImgView.userInteractionEnabled = true;
    smsCloudPriHeadImgView.image = [SmsCloudHead SmsCloudImageNamed:@"smsCloudHeadPriAgreemnet"];
    [self addSubview:smsCloudPriHeadImgView];
    [smsCloudPriHeadImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@([SmsCloudHead SmsCloudScreewRatio:30]));
        make.top.equalTo(smsCloudUserHeadImgView.mas_bottom).offset([SmsCloudHead SmsCloudScreewRatio:64]);
        make.width.equalTo(@([SmsCloudHead SmsCloudScreewRatio:40]));
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:40]));
    }];
    UILabel * smsCloudMainPriHeadLab = [[UILabel alloc] init];
    smsCloudMainPriHeadLab.textColor = [SmsCloudHead SmsCloudColorHexString:@"#222222"];
    smsCloudMainPriHeadLab.font = [UIFont systemFontOfSize:[SmsCloudHead SmsCloudScreewRatio:28] weight:UIFontWeightRegular];
    smsCloudMainPriHeadLab.text = @"隐私协议";
    [self addSubview:smsCloudMainPriHeadLab];
    [smsCloudMainPriHeadLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(smsCloudPriHeadImgView.mas_right).offset([SmsCloudHead SmsCloudScreewRatio:22]);
        make.centerY.equalTo(smsCloudPriHeadImgView);
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:39]));
    }];
    UIImageView * smsCloudPriHeadGoImgView = [[UIImageView alloc] init];
    smsCloudPriHeadGoImgView.userInteractionEnabled = true;
    smsCloudPriHeadGoImgView.image = [SmsCloudHead SmsCloudImageNamed:@"smsCloudAgreentGo"];
    [self addSubview:smsCloudPriHeadGoImgView];
    [smsCloudPriHeadGoImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(smsCloudMainPriHeadLab);
        make.right.equalTo(@(-[SmsCloudHead SmsCloudScreewRatio:32]));
        make.width.equalTo(@([SmsCloudHead SmsCloudScreewRatio:10]));
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:18]));
    }];
    UIButton * smsCloudPriHeadGoBtn = [[UIButton alloc] init];
    [smsCloudPriHeadGoBtn addTarget:self action:@selector(smsCloudPriHeadGo) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:smsCloudPriHeadGoBtn];
    [smsCloudPriHeadGoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@([SmsCloudHead SmsCloudScreewRatio:0]));
        make.right.equalTo(@([SmsCloudHead SmsCloudScreewRatio:0]));
        make.top.equalTo(smsCloudUserHeadGoBtn.mas_bottom);
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:104]));
    }];
}
- (void)smsCloudUserHeadGo{
    if(self.SmsCloudMainUserBlock){
        self.SmsCloudMainUserBlock();
    }
}
- (void)smsCloudPriHeadGo{
    if(self.SmsCloudMainPriBlock){
        self.SmsCloudMainPriBlock();
    }
}
@end
